var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, e, n, o) {
    var i, r = arguments.length, c = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, n) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(t, e, n, o); else for (var a = t.length - 1; 0 <= a; a--) (i = t[a]) && (c = (r < 3 ? i(c) : 3 < r ? i(e, n, c) : i(e, n)) || c);
    return 3 < r && c && Object.defineProperty(e, n, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("EggsHintItemView"), s = e("MyProfitView"), c = e("GameConfig"), l = e("UIManager"), d = e("EggsManager"), u = cc._decorator, p = u.ccclass, h = u.property, f = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.scrollView = null, t.item = null, t.items = [], t.isInit = !1, t;
    }
    return i(t, e), t.prototype.onEnable = function() {
        e.prototype.onEnable.call(this), this.isInit || (this.isInit = !0, this.init()), 
        this.changeBtn();
    }, t.prototype.changeBtn = function() {
        var e = this;
        this.items.forEach(function(t) {
            return e.delayBtn(t.myButton);
        });
    }, t.prototype.init = function() {
        var i = this;
        GA.Info.underCheck ? (c.GC.eggHintConfig.forEach(function(t) {
            var e = cc.instantiate(i.item.node), n = e.getComponent(r.default);
            n && (n.init(t.t, t.c), e.parent = i.scrollView.content, i.items.push(n));
        }), c.GC.eggGunConfig.forEach(function(t) {
            var e = cc.instantiate(i.item.node), n = e.getComponent(r.default);
            n && (n.init(t.t, t.c), e.parent = i.scrollView.content, i.items.push(n));
        })) : (c.GC.eggHintConfig.forEach(function(t) {
            var e = cc.instantiate(i.item.node), n = e.getComponent(r.default);
            n && (n.init(t.t, t.c), e.parent = i.scrollView.content, i.items.push(n));
        }), c.GC.eggGunConfig.forEach(function(t, e) {
            var n, o;
            e <= c.GC.maxEggIdx && (-2 == (n = d.default.getInstance().checkEggGun(e)) || (e = (o = cc.instantiate(i.item.node)).getComponent(r.default)) && (e.init(t.t, t.c), 
            e.eggsSprite.node.color = n < 0 ? cc.Color.BLACK : cc.Color.WHITE, o.parent = i.scrollView.content, 
            i.items.push(e)));
        })), this.item.node.zIndex = 100;
    }, t.prototype.callback = function(t) {
        var e, t = t.target;
        t && t.parent && t.parent.parent && (e = t.parent.parent.getComponent(r.default), 
        l.default.getInstance().loadPnl("hint").then(function(t) {
            t.titleLabel.string = e.title, t.contentLabel.string = e.content;
        }), this.changeBtn());
    }, a([ h(cc.ScrollView) ], t.prototype, "scrollView", void 0), a([ h(r.default) ], t.prototype, "item", void 0), 
    a([ p ], t);
}(s.default);

n.default = f;